import request from '@/config/axios'

export interface NetPackageVO {
	id: number
	commId: number
	netSysId: number
	lfPackId: number
	packType: number
	packName: string
	serviceProvider: number
	price: number
	duration: number
	speed: number
	sort: number
	remark: string
	buyTimes: number
	packStatus: number
	houseId: number
	bindPackId: string
	childCount: number
	isReNew: number
	isNeedPurchaseOfficialPackageFirst: number
	isLimitByValidityPeriod: number
}

//获得凌风套餐分页
export const getPage = async (params: object) => {
	return await request.get({ url: `/zwsj/net-package/page`, params })
}

// 获得凌风套餐
export const getPackage = async (id: number) => {
	return await request.get({ url: `/zwsj/net-package/get?id=` + id })
}

// 创建凌风套餐
export const createPackage = async (data: NetPackageVO) => {
	return await request.post({ url: `/zwsj/net-package/create`, data })
}

// 删除凌风套餐
export const deletePackage = async (id: number) => {
	return await request.delete({ url: `/zwsj/net-package/delete?id=` + id })
}

// 更新凌风套餐
export const updatePackage = async (data: object) => {
	return await request.put({ url: `/zwsj/net-package/update`, data })
}

/**获得凌风系统的套餐信息*/
export const getLfPackage = async (params: object) => {
	return await request.get({ url: `/zwsj/net-package/get/lf`, params })
}
